/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ejb;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author timoteus78
 */
@Entity
@Table(name = "User")
@NamedQueries({@NamedQuery(name = "User.findByUName", query = "SELECT u FROM User u WHERE u.uName = :uName"), @NamedQuery(name = "User.findByPassword", query = "SELECT u FROM User u WHERE u.password = :password"), @NamedQuery(name = "User.findByUType", query = "SELECT u FROM User u WHERE u.uType = :uType"), @NamedQuery(name = "User.findByFName", query = "SELECT u FROM User u WHERE u.fName = :fName"), @NamedQuery(name = "User.findByLName", query = "SELECT u FROM User u WHERE u.lName = :lName")})
public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "uName", nullable = false)
    private String uName;
    @Column(name = "password", nullable = false)
    private String password;
    @Column(name = "uType")
    private Integer uType;
    @Column(name = "fName")
    private String fName;
    @Column(name = "lName")
    private String lName;

    public User() {
    }

    public User(String uName) {
        this.uName = uName;
    }

    public User(String uName, String password) {
        this.uName = uName;
        this.password = password;
    }

    public String getUName() {
        return uName;
    }

    public void setUName(String uName) {
        this.uName = uName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getUType() {
        return uType;
    }

    public void setUType(Integer uType) {
        this.uType = uType;
    }

    public String getFName() {
        return fName;
    }

    public void setFName(String fName) {
        this.fName = fName;
    }

    public String getLName() {
        return lName;
    }

    public void setLName(String lName) {
        this.lName = lName;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (uName != null ? uName.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof User)) {
            return false;
        }
        User other = (User) object;
        if ((this.uName == null && other.uName != null) || (this.uName != null && !this.uName.equals(other.uName))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ejb.User[uName=" + uName + "]";
    }

}
